﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AccountView.aspx.cs" Inherits="JKF.Web.SMS.Sms_Account.AccountView" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
        <%= RegScript("~/js/jquery.1.5.js")%>
        <%= RegScript("~/js/jquery.nhis.js")%>
        <%= RegScript("~/js/jquery.rchis.js")%>
        <%= RegScript("~/js/jquery-ui-custom.min.js")%>
        <%= RegScript("~/js/css.js")%>
        <%= RegScript("~/js/DatePicker/WdatePicker.js")%>
        <%= RegScript("~/js/Common.js")%>
        <%= RegScript("~/js/Jquery.commonGrid.js")%>
        <script src="../../js/Uppop/tipswindown2.js"  type="text/javascript"></script>

        <link href="../../App_Themes/Theme2/Include.css"   rel="stylesheet" type="text/css" />
          <script type="text/javascript">
              var AppPath = '<%=AppPath %>';
              var handler = AppPath + '/do/SMS/Sms_Account.do';
              var PageSize = 20;
              var pager = null;
              $(function () {
                  pager = $('#divPager').pager(AppPath, handler, function () {
                      return { ActionName: 'GetSMSAccounts', searchItem: "SHOP_CODE", matchWay:"=", keyword:"<%=ShopCode%>" };
                  }, function (data) {
                      var tbody = $('#tb tbody');
                      tbody.empty();
                      if (data && data.Entity && data.Entity.length) {
                          data = data.Entity
                          var tr, td;
                          for (var i = 0; i < data.length; i++) {
                              var item = data[i];
                              tr = $("<tr key=" + item.SHOP_CODE + "></tr>").appendTo(tbody);

                              var btns
                              if (item.STATUS == "0") {
                                  btns = '未开通'
                              }
                              else {
                                  btns += '<input  class="btn_style" value="查看分配日志"    type="button" onclick="viewChargeLog(' + "'" + item.SHOP_CODE + "'" + ')" >';
                              }
                              $('<td></td>').appendTo(tr).html(btns);
                              $('<td></td>').appendTo(tr).text(item.SHOP_CODE);
                              $('<td></td>').appendTo(tr).text(item.SHOP_NAME);
                              $('<td></td>').appendTo(tr).text(item.MOBILE);
                              $('<td></td>').appendTo(tr).text(item.SMS_ACCOUNT);
                              $('<td></td>').appendTo(tr).text(item.AMOUNT);
                              $('<td></td>').appendTo(tr).text(item.NUM_LEFT);
                              $('<td></td>').appendTo(tr).text(item.NUM_SENDED);
                              $('<td></td>').appendTo(tr).text(item.STATUS_CN);
                              $('<td></td>').appendTo(tr).text(item.SIGNATURE);
                              $('<td></td>').appendTo(tr).text(item.DATE_CREATE);
                          }
                      } else {
                          tbody.html('<tr><td colspan="11" style="text-align: center">没有数据!</td></tr>');

                      }

                      var tbHeight = $(window).height() - $("#divPager").height() - 10;
                      tbHeight = tbHeight < 300 ? 300 : tbHeight
                      $("#tb").H8_Grid($("#divPager"), tbHeight);
                  }, PageSize, true);

              });

              function viewChargeLog(shopCode) {
                  window.parent.pop("短信分配日志", '<%= ResolveUrl("~/SMS/Sms_Account/Charge_Log.aspx?shopCode=") %>' + shopCode, 800, 560, null)
              };
      </script>
</head>
<body>
      <div class="warrper_body">  
         <div class="index" style=" overflow:hidden">            
           
            <div class="index_table">
                <table id="tb" class="common_table">
                    <thead>
                        <tr>
                            <th width="250px" orderaction="false">操作</th>
                            <th width="80px" ordertype="string">店铺编码</th>
                            <th width="250px" ordertype="string">店面名称</th>
                            <th width="100px" ordertype="string">联系电话</th>
                            <th width="100px" ordertype="string">短信账号</th>
                            <th width="100px" ordertype="string">累计分配条数</th>
                            <th width="100px" ordertype="string">剩余条数</th>
                            <th width="100px" ordertype="string">已发送条数</th>
                            <th width="100px" ordertype="string">开通状态</th>
                            <th width="200px" ordertype="string">签名</th>
                            <th width="100px" ordertype="string">开通时间</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="10" style="text-align: center">点击搜索查看数据</td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="page" id="divPager"></div>      
        </div>
     </div> 
</body>
</html>
